﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AMV.WEB.Controls
{
    public partial class Calendar : System.Web.UI.UserControl
    {
        private bool enabled = true;
        public bool Enabled
        {
            get
            {
                return enabled;
            }
            set
            {
                enabled = value;
                ddlDay.Enabled = ddlMonth.Enabled = ddlYear.Enabled = value;
            }
        }


        private DateTime date = DateTime.Now;

        public DateTime Date
        {
            get
            {
                string year = ddlYear.SelectedValue;
                string month = ddlMonth.SelectedValue;
                string day = ddlDay.SelectedValue;

                date = new DateTime(int.Parse(year), int.Parse(month), int.Parse(day));

                return date;
            }
            set
            {
                date = value;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}